import { DownOutlined, PlusOutlined } from '@ant-design/icons';
import { history } from 'umi';
import React, { useState, useRef } from 'react';
import { GridContent } from '@ant-design/pro-layout';
import { getAllSignedRecord } from './service';
import ProTable from '@ant-design/pro-table';

const Record = () => {
  const actionRef = useRef();
  const columns = [
    {
      title: '会员名称',
      dataIndex: 'labelName',
    },
    {
      title: '签到时间',
      dataIndex: 'labelType',
      hideInSearch:true
    },
    {
      title: '签到方式',
      dataIndex: 'state',
      hideInSearch:true
    },
    {
      title: '课程',
      dataIndex: 'createUser',
      hideInSearch:true
    },
    {
      title: '卡名称',
      dataIndex: 'createTime',
    },
    {
      title: '费用',
      dataIndex: 'createTime',
      hideInSearch:true
    },
    {
      title: '场馆',
      dataIndex: 'createTime',
    },
    {
      title: '教练',
      dataIndex: 'createTime',
    },
    {
      title: '备注',
      dataIndex: 'createTime',
      hideInSearch:true
    },
    {
      title: '操作',
      render: (text, record) => (
        <>
          <a onClick={() => this.handleUpdateModalVisible(true, record)}>取消预约</a>
        </>
      ),
    },
  ];
  return (
    <GridContent>
     <ProTable
        actionRef={actionRef}
        rowKey="userId"
        request={params => {
          let _params={
            pageNum:params.current,
            ...params,
          }
          delete _params.current
          return getAllSignedRecord(_params)
        }}
        postData={result=>result.list}
        columns={columns}
      />
    </GridContent>
  );
};

export default Record;
